﻿// ====================================================================
//  Texy.net - XML-RPC client for Texy! formatter
//  (c) 2006 Aleš Roubíček - Creative Commons 2.5 License
// --------------------------------------------------------------------
//  version: 1.0 RC2
// ====================================================================

using System;
using System.Configuration;

namespace Rarous.TexyNet.Configuration
{
    /// <summary>
    /// 
    /// </summary>
    public class HeadingModuleElement : ConfigurationElement
    {
        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public HeadingModuleElement()
        { }
        #endregion

        #region Properties
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationProperty("allowedSurrounded", IsRequired = false, DefaultValue = true)]
        public bool AllowedSurrounded
        {
            get { return Convert.ToBoolean(this["allowedSurrounded"]); }
            set { this["allowedSurrounded"] = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationProperty("allowedUnderlined", IsRequired = false, DefaultValue = true)]
        public bool AllowedUnderlined
        {
            get { return Convert.ToBoolean(this["allowedUnderlined"]); }
            set { this["allowedUnderlined"] = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationProperty("top", IsRequired = false, DefaultValue = 1)]
        public int Top
        {
            get { return Convert.ToInt32(this["top"]); }
            set { this["top"] = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationProperty("balancing", IsRequired = false, DefaultValue = 1)]
        public int Balancing
        {
            get { return Convert.ToInt32(this["balancing"]); }
            set { this["balancing"] = value; }
        }
        #endregion

        #region Override Methods
        /// <summary>
        /// Nastavuje výchozí hodnoty
        /// </summary>
        protected override void InitializeDefault()
        {
            AllowedSurrounded = true;
            AllowedUnderlined = true;
            Top = 1;
            Balancing = 1;
            base.InitializeDefault();
        }
        #endregion
    }
}
